using System;
using System.ComponentModel;
using System.Collections.Generic;

using Castle.ActiveRecord;

/// <summary>
/// Business entity class generated from ContactPoint
/// </summary>
/// <remarks>
/// Created by: huanhvhd
/// Created date: [2011-04-23]
/// </remarks>
namespace TVN.ShopMan.ActiveModels
{
	[ActiveRecord("ContactPoint")]
	public partial class ContactPoint : ActiveRecordBase<ContactPoint>
	{
		#region Properties
		
        /// <summary>
        /// All properties
        /// </summary>
		public class Properties
		{
			public const string Id = "Id";
			public const string Name = "Name";
			public const string Description = "Description";
			public const string IsActive = "IsActive";
			public const string CreatedDate = "CreatedDate";
			public const string LastModifiedDate = "LastModifiedDate";
			public const string Creator = "Creator";
			public const string LastModifier = "LastModifier";
		}

		#endregion

		#region Private fields

		private int _id;
		private string _name;
		private string _description;
		private bool _isActive;
		private DateTime _createdDate;
		private DateTime? _lastModifiedDate;
		private Account _creatorId;
		private Account _lastModifierId;

		private IList<ContactPointPhoneNumber> _contactPointPhoneNumbersContactPointId = new List<ContactPointPhoneNumber>();
		private IList<SupplierContactPoint> _supplierContactPointsContactPointId = new List<SupplierContactPoint>();

		#endregion

		#region Constructors

		public ContactPoint()
		{
		}

		#endregion

		#region Properties

		[PrimaryKey("Id", Access = PropertyAccess.NosetterLowercaseUnderscore)]
		public int Id
		{
			get { return _id; }
		}

		[Property("Name", NotNull = true, Length = 256)]
		public string Name
		{
			get { return _name; }
			set { _name = value; }
		}

		[Property("Description", ColumnType = "StringClob")]
		public string Description
		{
			get { return _description; }
			set { _description = value; }
		}

		[Property("IsActive", NotNull = true)]
		public bool IsActive
		{
			get { return _isActive; }
			set { _isActive = value; }
		}

		[Property("CreatedDate", NotNull = true)]
		public DateTime CreatedDate
		{
			get { return _createdDate; }
			set { _createdDate = value; }
		}

		[Property("LastModifiedDate")]
		public DateTime? LastModifiedDate
		{
			get { return _lastModifiedDate; }
			set { _lastModifiedDate = value; }
		}

		[BelongsTo("CreatorId", Type = typeof(Account))]
		public Account Creator
		{
			get { return _creatorId; }
			set { _creatorId = value; }
		}

		[BelongsTo("LastModifierId", Type = typeof(Account))]
		public Account LastModifier
		{
			get { return _lastModifierId; }
			set { _lastModifierId = value; }
		}

		[HasMany(typeof(ContactPointPhoneNumber), Table="ContactPointPhoneNumber", ColumnKey="ContactPointId")]
		public IList<ContactPointPhoneNumber> ContactPointPhoneNumbersContactPointId
		{
			get { return _contactPointPhoneNumbersContactPointId; }
			set { _contactPointPhoneNumbersContactPointId = value; }
		}
		[HasMany(typeof(SupplierContactPoint), Table="SupplierContactPoint", ColumnKey="ContactPointId")]
		public IList<SupplierContactPoint> SupplierContactPointsContactPointId
		{
			get { return _supplierContactPointsContactPointId; }
			set { _supplierContactPointsContactPointId = value; }
		}
		#endregion

	} }
